﻿using System;
using System.Collections.Generic;
using System.Text;
using WeShare.WeiXin.Common.EnumKey;

namespace WeShare.WeiXin.Mp.Other.Entity
{
    public class AutoReplyRule : BaseRes
    {
        /// <summary>
        /// 关注后自动回复是否开启，0代表未开启，1代表开启
        /// </summary>
        public int is_add_friend_reply_open { get; set; }
        /// <summary>
        /// 消息自动回复是否开启，0代表未开启，1代表开启
        /// </summary>
        public int is_autoreply_open { get; set; }
        /// <summary>
        /// 关注后自动回复的信息
        /// </summary>
        public ReplayContent add_friend_autoreply_info { get; set; }
        /// <summary>
        /// 消息自动回复的信息
        /// </summary>
        public ReplayContent message_default_autoreply_info { get; set; }
        /// <summary>
        /// 关键词自动回复的信息
        /// </summary>
        public List<KeywordInfo> keyword_autoreply_info { get; set; }

    }

    public class ReplayContent
    {
        /// <summary>
        /// 自动回复的类型。关注后自动回复和消息自动回复的类型仅支持文本（text）、图片（img）、语音（voice）、视频（video），关键词自动回复则还多了图文消息（news）
        /// </summary>
        public AutoReplyType type { get; set; }
        /// <summary>
        /// 对于文本类型，content是文本内容，对于图文、图片、语音、视频类型，content是mediaID
        /// </summary>
        public string content { get; set; }

        public NewsInfo news_info { get; set; }
    }

    public class KeywordInfo
    {
        public string rule_name { get; set; }
        public long create_time { get; set; }
        public ReplyMode reply_mode { get; set; }
        /// <summary>
        ///匹配的关键词列表
        /// </summary>
        public KeywordListInfo keyword_list_info { get; set; }
    }

    public class KeywordListInfo
    {
        public AutoReplyType type { get; set; }
        /// <summary>
        /// 匹配模式
        /// </summary>
        public MatchMode match_mode { get; set; }
        public string content { get; set; }
    }
    /// <summary>
    /// 图文消息信息
    /// </summary>
    public class NewsInfo
    {
        /// <summary>
        /// 图文消息的标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        ///摘要
        /// </summary>
        public string author { get; set; }
        /// <summary>
        ///作者
        /// </summary>
        public string digest { get; set; }
        /// <summary>
        ///是否显示封面，0为不显示，1为显示
        /// </summary>
        public string show_cover { get; set; }
        /// <summary>
        /// 封面图片的URL
        /// </summary>
        public string cover_url { get; set; }
        /// <summary>
        /// 正文的URL
        /// </summary>
        public string content_url { get; set; }
        /// <summary>
        /// 	原文的URL，若置空则无查看原文入口
        /// </summary>
        public string source_url { get; set; }
    }
}
